/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:           sqbang                                              *
 * Email:            sqbang@ustc.edu                                     *
 * Date:             2012.02.14                                          *
 *                                                                       *
 *************************************************************************/

namespace DOGOS
{

inline void
Logger::log_abort(
    const std::string& message,
    const std::string& file_name,
    const int line)
{
    d_abort_appender->logMessage(message, file_name, line);
}


inline void
Logger::log_warning(
    const std::string& message,
    const std::string& file_name,
    const int line)
{
    if (d_log_warning)
    {
        d_warning_appender->logMessage(message, file_name, line);
    }
}


inline void
Logger::log_debug(
    const std::string& message,
    const std::string& file_name,
    const int line)
{
    if (d_log_debug)
    {
        d_debug_appender->logMessage(message, file_name, line);
    }
}


inline void
Logger::set_abort_appender(
    Appender* appender)
{
    d_abort_appender = appender;
}


inline void
Logger::set_warning_appender(
    Appender* appender)
{
    d_warning_appender = appender;
}


inline void
Logger::set_debug_appender(
    Appender* appender)
{
    d_debug_appender = appender;
}


inline void
Logger::set_warning(
    bool onoff)
{
    d_log_warning = onoff;
}


inline void
Logger::set_debug(
    bool onoff)
{
    d_log_debug = onoff;
}

}
